/**
 * Created by Fantasy on 2016/4/12.
 */
define(function () {
    'use strict';
    return {
        /**
         * the comment calculation
         * @param defaultNumber
         */
        commentCalculation: function (defaultNumber) {
            var startsList = [{
                    activeHover: false,
                    halfActive: false
                }, {
                    activeHover: false,
                    halfActive: false
                }, {
                    activeHover: false,
                    halfActive: false
                }, {
                    activeHover: false,
                    halfActive: false
                }, {
                    activeHover: false,
                    halfActive: false
                }],

                fontNumber = Math.floor(defaultNumber / 2),
                endNumber = defaultNumber.toString().split('.')[1];
            _.each(startsList, function (stars, index) {
                if (index < fontNumber) {
                    stars.activeHover = true;
                }
                if (!!endNumber && fontNumber === index) {
                    stars.halfActive = true;
                }
            });
            return startsList;
        }
    }
});